package com.qhhc.hospital.service.impl;

import com.qhhc.hospital.entity.PatientUser;
import com.qhhc.hospital.mapper.PatientUserMapper;
import com.qhhc.hospital.service.IPatientUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatientUserService implements IPatientUserService {
    @Autowired
    PatientUserMapper patientUserMapper;
    
    @Override
    public int insert(PatientUser patientUser) {
        int count = patientUserMapper.insertPatientUser(patientUser);
        return count;
    }
    
    @Override
    public List<PatientUser> selectAll() {
        List<PatientUser> patientUsers = patientUserMapper.selectAllPatientUsers();
        return patientUsers;
    }
    
    @Override
    public PatientUser selectById(Integer pId) {
        PatientUser patientUser = patientUserMapper.selectPatientUserById(pId);
        return patientUser;
    }
    
    @Override
    public int update(PatientUser patientUser) {
        return patientUserMapper.updatePatientUser(patientUser);
    }
    
    @Override
    public int delete(Integer pId) {
        return patientUserMapper.deletePatientUser(pId);
    }
} 